import QtQuick 1.1
import com.nokia.meego 1.0
import "Logic.js" as Logic

Page {
    id: qnm_about
    tools: tool_only_back
    orientationLock: appWindow.lockOrientation()

    BackgroundPage { }

    Item {
        id: mainPane
        //anchors.centerIn: parent
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.top: parent.top
        anchors.bottom: parent.bottom
        anchors.leftMargin: 12
        anchors.rightMargin: 12
        anchors.topMargin: 12
        anchors.bottomMargin: 12

        //width: parent.width
        //height: parent.height

        Item {
            id: img_about

            anchors.top: parent.top
            anchors.left: parent.feft
            width: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? parent.width/2 : parent.width
            height: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? parent.height : parent.height/2

            Image {
                id: imgAbout
                source: "./pictures/splash.png"

                width: parent.width
                height: parent.height
                Behavior on width { NumberAnimation { duration: 700 } }
                Behavior on height { NumberAnimation { duration: 700 } }

                anchors.centerIn: parent
                smooth: true
                fillMode: Image.PreserveAspectFit
            }
        }

        //------------------

        Item {
            id: textAbout
            width: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? parent.width/2 : parent.width
            height: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? parent.height : parent.height/2

            anchors.top: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? parent.top : img_about.bottom
            anchors.left: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? img_about.right : parent.left

            anchors.leftMargin: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? 10 : 0
            anchors.rightMargin: 10

            Label {
                id: lblQnetMan
                anchors.horizontalCenter: parent.horizontalCenter
                text: "QNetMan2";
                font.pixelSize: 38
                font.bold: true
                color: "blue"
            }

            Flickable {
                id: flickAboutText
                anchors.top: lblQnetMan.bottom
                //anchors.topMargin: 5
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 5
                contentHeight: colAboutText.height
                contentWidth: colAboutText.width
                flickableDirection: Flickable.VerticalFlick
                height: textAbout.height - 60
                width: textAbout.width
                clip: true

                Column {
                    id: colAboutText
                    spacing: 20
                    Label { text: "<b>" + qsTr("Version:") +"</b>  "+ appWindow.version }
                    Label { text: "<b>" + qsTr("Author:") + "</b>  " + qsTr("Anatoly Kozlov") }
                    Label { text: "<b>" + qsTr("Thanks:")+"</b>" }
                    Label { text: "<ul><li>"+qsTr("Vladimir Sinichkin - for translation")+"</li></ul>" }
                    Label { text: "<ul><li>"+qsTr("Krisztian Olah - for testing and <br>good ideas")+"</li></ul>" }
                    Label { text: "<ul><li>"+qsTr("Thanks a lot to everyone <br>who made a donation ;)")+"</li></ul>" }
                    Label { text: "<b>" + qsTr("Licence:")+"</b> GPL v3" }
                    Label { anchors.horizontalCenter: parent.horizontalCenter; font.pixelSize: 19; text: "<a href='http://www.gnu.org/licenses/gpl.html'>http://www.gnu.org/licenses/gpl.html</a>"; onLinkActivated: { Qt.openUrlExternally (link) } }
                    Label { text: qsTr("This application is open source (C++/QML).\nSource code and other details \non the web-page of the project:")}
                    Label { anchors.horizontalCenter: parent.horizontalCenter; font.pixelSize: 19; text: "<a href='https://projects.developer.nokia.com/qnetman'>http://projects.developer.nokia.com/qnetman</a>"; onLinkActivated: { Qt.openUrlExternally (link) } }
                    //Label { anchors.horizontalCenter: parent.horizontalCenter; font.pixelSize: 20; text: "E-mail:  <a href='mailto:qnetworkmanager@gmail.com'>qnetworkmanager@gmain.com</a><br/>"; onLinkActivated: { Qt.openUrlExternally (link) } }
                    Label { text: "<b>E-mail:</b>"; }
                    Label { anchors.horizontalCenter: parent.horizontalCenter; font.pixelSize: 20; text: "<a href='mailto:qnetworkmanager@gmail.com'>qnetworkmanager@gmain.com</a>"; onLinkActivated: { Qt.openUrlExternally (link) } }
                    Label { text: "<b>" + qsTr("Donate:")+"</b>" }
                    Label { text: qsTr("You can donate to project via PayPal to") }
                    Label { anchors.horizontalCenter: parent.horizontalCenter; text: "<a href='mailto:qnetworkmanager@gmail.com'>qnetworkmanager@gmain.com</a><br/>"; onLinkActivated: { Qt.openUrlExternally (link) } }

                }

            } //Flickable

            ScrollDecorator {
                flickableItem: flickAboutText
            }
        } //Column
    } //Item

}
